<?php
/**
 * 学生信息管理
 */
//session_start();
//$login_type = $_SESSION['login_type'];//登录类型
include "../util/DBUtil.php";
?>
<!--上部分 班级 搜索-->
<link rel="stylesheet" href="../css/iframe_content.css">
<link rel="stylesheet" href="../css/hidden.css">
<script src="../js/selectchang.js"></script>
<div class="head <?php echo $login_type==0? 'hidden':''?>"><!--学生隐藏-->
    <!--除了管理会员外不能查看其它班级学生-->
    <div class="select <?php echo $login_type != 1 ? 'hidden' : '' ?>">
        <span>选择班级:</span>
        <select name="" id="select" onchange="change(0)">
            <option value="-1">默认</option>
            <?php
            //获取所有班级
            $sql = "select * from tb_grade";
            $db = new DBUtil();
            $result = $db->query($sql);//存储所有班级信息
            echo $sql;
            print_r($result);
            foreach ($result as $item) {
                ?>
                <option value="<?php echo $item['id'] ?>"><?php echo $item['grade'] ?></option>
                <?php
            }
            ?>
        </select>
    </div>
    <!--搜索-->
    <form action="student_info.php?action=key" method="post">
        <input type="text" name="key" placeholder="输入要查找的关键字">
        <select name="key_type" id="">
            <option value="0" selected>学号搜索</option>
            <option value="1">名字搜索</option>
        </select>
        <button type="submit" formtarget="stuInfo">搜索</button>
    </form>
</div>

<iframe src="student_info.php" frameborder="0" name="stuInfo" class="info_iframe"></iframe>

